package me.spring.cloud.components.starter.rabbitmq.configure;

import me.spring.cloud.common.components.rabbitmq.service.IMessageService;
import me.spring.cloud.common.components.rabbitmq.service.RqMessageService;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author: luffy
 * @create: 2018-11-06 15:26
 **/
@Configuration
public class RabbitMqConfiguration {

  /**
   * 定义消息转换实例
   *
   * @return
   */
  @Bean
  public MessageConverter jackson2JsonMessageConverter() {
    return new Jackson2JsonMessageConverter();
  }


  @Bean
  public IMessageService iMessageService(){
    return new RqMessageService();
  }
}
